home *** CD-ROM | disk | FTP | other *** search
- function camControl()
- {
- parentColor.setTransform(camColor.getTransform());
- var _loc5_ = sX / this._width;
- var _loc4_ = sY / this._height;
- _parent._x = cX - this._x * _loc5_;
- _parent._y = cY - this._y * _loc4_;
- _parent._xscale = 100 * _loc5_;
- _parent._yscale = 100 * _loc4_;
- friction = 10;
- if(!setVars)
- {
- xPlus = 0;
- maxPlus = 120;
- xSpeed = 10;
- setVars = true;
- }
- if(_root.cm.die == false)
- {
- if(Key.isDown(39))
- {
- xPlus += xSpeed;
- }
- else if(Key.isDown(37))
- {
- if(_root.level != 6)
- {
- xPlus -= xSpeed;
- }
- }
- }
- else
- {
- xPlus = 0;
- }
- if(xPlus > maxPlus)
- {
- xPlus = maxPlus;
- }
- else if(xPlus < - maxPlus)
- {
- xPlus = - maxPlus;
- }
- if(_root.level != 2)
- {
- _X = _X + ((_root.cm._x + xPlus - _X) / friction + shakeX);
- _Y = _Y + ((_root.cm._y - 120 - _Y) / friction + shakeY);
- }
- }
- function resetStage()
- {
- var _loc2_ = {ra:100,rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0};
- parentColor.setTransform(_loc2_);
- _parent._xscale = 100;
- _parent._yscale = 100;
- _parent._x = 0;
- _parent._y = 0;
- }
- shakeX = 0;
- shakeY = 0;
- _visible = false;
- var oldMode = Stage.scaleMode;
- Stage.scaleMode = "exactFit";
- var cX = Stage.width / 2;
- var cY = Stage.height / 2;
- var sX = Stage.width;
- var sY = Stage.height;
- Stage.scaleMode = oldMode;
- var camColor = new Color(this);
- var parentColor = new Color(_parent);
- this.onEnterFrame = camControl;
- camControl();
- this.onUnload = resetStage;
-